package com.util;

import java.sql.Timestamp;
import java.util.Date;

public class CompareTime {
	
	public String compareToTime(Date beginTime,Date endTime ){
		  
		  Timestamp timestamp = new java.sql.Timestamp(new java.util.Date().getTime()); 
		  String type="forever";
		  if(timestamp.compareTo(beginTime)==-1)
		  {
			  type="waiting";
		  }
		  
		  if(timestamp.compareTo(beginTime)==1 && timestamp.compareTo(endTime)==-1 )
		  {
			  type= "running";
		  }
		  if(timestamp.compareTo(endTime)==1)
		  {
			  type= "pass";
		  }
		  return type;
	}

}
